For a security document identification apparatus, there is commonly a difficulty in the storage of a sample image. The key problem is that since the data volume of the sample image is large and the identification apparatus has to operate fast and continuously, the time for storage is short. An ordinary teller machine processes eight security documents per second, the average processing time for each of the security documents is 125 ms, the overhead of the system is about 20 ms, the time for the serial port communication is 15 ms, the sample images are collected in parallel which cost about 10 ms in the total CPU time, therefore the remaining time is about: 125 ms−20 ms−15 ms−10 ms=80 ms. Based on a TMS320 platform with the frequency of 600MCPU, the time for identifying the security documents (including category, denomination, orientation, counterfeit, serial number) is about 65 ms, and thus the time for storing the sample image must be controlled in less than 15 ms. It is needed to store at least three sample images so as to store complete image information. Now it is assumed that, among the three sample images, one image is a white light sample image with a resolution of 480*800, another image is an infrared sample image with a resolution of 240*400, and a third image is a transmission sample image with a resolution of 240*400. In the white light sample image, the resolution of 480*800 is only used for the serial number area. The resolution of 240*400 is actually used. Therefore, it may be chosen to store all of the three sample images, or to convert the white light sample image into an image with the resolution of 240*400 and then store the three images with the resolution of 240*400. In the case of the storage in accordance with the existing two methods, the time-consuming is as follows:
1. if the image is stored point-by-point, the total number of operations is 240*400+240*400+480*800=576,000. In the off-chip storage based on the TMS320 platform of 600MCPU frequency, the three images are stored as images with the resolution of 240*400. That is to say, the two images with middle resolution are directly stored; and for the image with high resolution, one row is stored every two rows and one column is stored every two column, so that the data volume of the image with high resolution is a quarter of the original data volume. In this way, the storage time is about 70 ms (the image resolution conversion and storage are performed simultaneously) and is still far slower than 15 ms.
2. If a mass of images is copied, namely if a basic function of C language, i.e. the memcpy function, is used, the storage time is about 18 ms and still can not meet the requirement. It is disadvantage that this function requires continuous occupation of CPU which can not be interrupted. The continuous occupation conflicts with the image collection. The copy of a large amount of data may cause that the image collection is completely disordered and the system is broken down.
In summary, the use of the traditional image storage method is unable to meet the requirement to store the three high-resolution images in 15 ms, which even breaks the system down. Therefore, if the images need to be stored, it is only possible to reduce the identification speed of the device or decrease the functions of identification of the device.
Therefore, a method which can fast store the image data is needed to solve the above mentioned problem.